package com.xyg.sample.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.xyg.common.model.BaseEntity;

@Entity
@Table(name="score")
public class Score extends BaseEntity<Score, Long>{

	private Double score;
	
	@ManyToOne(fetch=FetchType.LAZY)
	private Course course;
	
	@ManyToMany(fetch=FetchType.LAZY,mappedBy="scores",cascade=CascadeType.ALL)
	private Set<Student> students = new HashSet<>();

	public Double getScore() {
		return score;
	}

	public void setScore(Double score) {
		this.score = score;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}
	
	
}
